function verticalRotator(name,parentid,listHeight,detailHeight,timercount,pausecount,currentClass,rotateClass,slideSpeed)
{this.name=name;this.initialized=false;this.currentIndex=0;this.slideSpeed=slideSpeed;this.listItems=new Array();this.detailItems=new Array();this.currentClass=currentClass;this.rotateClass=rotateClass;this.timer=false;this.timercount=timercount;this.pausecount=pausecount;this.parent=$jq('#'+parentid);this.listHeight=listHeight;this.detailHeight=detailHeight;this.load=function(startIndex,listName,divName)
{var i=startIndex;var x=document.getElementById(listName+i);var y=document.getElementById(divName+i);while(typeof x!='undefined'&&x!=null&&typeof y!='undefined'&&y!=null)
{this.listItems.push($jq(x));this.detailItems.push($jq(y));i++;x=document.getElementById(listName+i);y=document.getElementById(divName+i);}
this.init();}
this.init=function()
{if(this.count()>0)
{this.parent.css('height',this.count()*this.listHeight+this.detailHeight);this.detail(0);}
else
{this.parent.css('height',0);}
this.initialized=true;this.start();}
this.start=function()
{this.play(this.timercount);}
this.play=function(duration)
{this.pause();this.timer=setTimeout(this.name+'.rotate();',duration);}
this.delay=function()
{this.play(this.pausecount);}
this.pause=function()
{if(this.timer)
clearTimeout(this.timer);}
this.rotate=function()
{if(this.currentIndex+1<this.count())
this.detail(this.currentIndex+1);else
this.detail(0);this.start();}
this.detail=function(index)
{if(index<this.count()&&index>=0)
{if(index!=0)
{this.listItems[index].addClass(this.rotateClass);}
if(this.initialized)
{this.listItems[this.currentIndex].removeClass(this.currentClass);this.listItems[this.currentIndex].removeClass(this.rotateClass);}
for(var i=0;i<this.count();i++)
{if(i!=index)
this.detailItems[i].slideUp(this.slideSpeed);}
if(index==0)
{this.listItems[index].addClass(this.rotateClass);}
if(this.initialized)
this.detailItems[index].slideDown(this.slideSpeed,eval('function callback() {'+this.name+'.listItems[index].addClass('+this.name+'.currentClass)}'));this.currentIndex=index;}
return false;}
this.count=function()
{return this.listItems.length;}}
function tabBlock(name,startTab,count,timercount,pausecount,autoplay)
{this.name=name;this.playing=false;this.tabs=new Array();this.pages=new Array();this.currentIndex=startTab;this.running=false;this.timer=false;if(typeof timercount=='undefined'||timercount==null)
this.timercount=5000;else
this.timercount=timercount;if(typeof pausecount=='undefined'||pausecount==null)
this.pausecount=15000;else
this.pausecount=pausecount;if(typeof autoplay=='undefined'||autoplay==null)
this.autoplay=false;else
this.autoplay=autoplay;if(typeof this.currentIndex!='undefined')
{if(this.currentIndex<0&&typeof count!='undefined'&&count!=null&&count>0)
{this.currentIndex=(Math.floor(Math.random()*count)+1);}}
else
this.currentIndex=1;this.count=function()
{return this.pages.length;}
this.add=function(id,tabobjectid)
{this.pages.push($jq('#'+id));this.tabs['T'+this.pages.length]=$jq('#'+tabobjectid);if(this.pages.length==this.currentIndex)
this.show(this.currentIndex);else
this.hide(this.pages.length-1);}
this.hide=function(index)
{this.pages[index].css('display','none');}
this.play=function(duration)
{this.running=true;this.playing=true;this.pause();this.timer=setTimeout(this.name+'.rotate();',duration);}
this.toggle=function()
{if(this.playing==true)
{this.playing=false;this.pause();}
else
this.play(0);}
this.pause=function()
{if(this.timer)
clearTimeout(this.timer);}
this.delay=function()
{this.play(this.pausecount);}
this.rotate=function()
{if(this.currentIndex+1<=this.count())
this.detail(this.currentIndex+1);else
this.detail(1);this.start();}
this.start=function()
{this.play(this.timercount);}
this.detail=function(index)
{this.currentIndex=index;for(var i=0;i<this.pages.length;i++)
{if(i==index-1)
{this.pages[i].css('display','block');if(typeof this.tabs['T'+(i+1)]!='undefined'&&this.tabs['T'+(i+1)]!=null)
this.tabs['T'+(i+1)].addClass('current');}
else
{this.hide(i);if(typeof this.tabs['T'+(i+1)]!='undefined'&&this.tabs['T'+(i+1)]!=null)
this.tabs['T'+(i+1)].removeClass('current');}}}
this.show=function(index)
{if(this.running)
this.delay();this.detail(index);}
if(this.autoplay==true)
this.play(this.timercount);}
var srcvalue='';var counter=0;var timer;function printcontent(panename){if(panename==null||panename=='')
panename='ContentPane'
myRef=window.open('/print.aspx','mywin','left=20,top=20,width=700,height=700,toolbar=1,resizable=1,scrollbars=yes');srcvalue=document.getElementById('dnn_'+panename).innerHTML;counter=10;waitfortarget();}
function waitfortarget(){counter--;if(!myRef.document.getElementById('dnn_ContentPane'))
{if(counter>0){timer=setTimeout("waitfortarget()",1500);}
else{alert('Unable to load article. Please try again later.');}}
else{donetarget();}}
function donetarget(){myRef.document.getElementById('dnn_ContentPane').innerHTML=srcvalue;myRef.print();}
function designCenterChangeStory(linkID,storyID,divID,targetID){var dtObj=document.getElementById(divID).getElementsByTagName('dt');var ddObj=document.getElementById(divID).getElementsByTagName('dd');document.getElementById(targetID).innerHTML=document.getElementById(storyID).innerHTML;for(var i=0;i<dtObj.length;i++){var aObj=dtObj[i].getElementsByTagName('a');for(var k=0;k<aObj.length;k++){if(aObj[k].id==linkID){$jq('#'+linkID).addClass('current');}
else{$jq('#'+aObj[k].id).removeClass('current');}}}}


/*
$jq().ready(function(){showShortArticle();});function getArticleExpander(){return $jq("div.article a[name=expander]:first");}
var currentExpander=0;function showShortArticle(){var pexp=$jq('#expandCollapseArea');if(pexp.length==0)
{var exp=getArticleExpander();pexp=null;var rexp=null;if(exp==null||exp.length==0)
{exp=$jq('div.article p:eq(3)');if(exp!=null&&exp.length>0)
exp.before('<p><a name="expander"></a></p>');exp=getArticleExpander();}
if(exp!=null&&exp.length>0)
{pexp=exp.parent();rexp=pexp.parent();var strCollapsed="<div id='expandCollapseArea'><div class='expandCollapse'><div class='option'>Turn OFF Collapse / Expand Article</div>";strCollapsed+="<a href='#' class='button' onclick='showFullArticle(); return false;'>Read Full Article</a><div class='clear'></div></div></div>";var strExpanded="<div id='expandExpandArea'><div class='expandCollapse'><div class='option'>Turn OFF Collapse / Expand Article</div>";strExpanded+="<a href='#' class='buttonUp' onclick='showShortArticle(); return false;'>Collapse Article</a><div class='clear'></div></div></div>";pexp.before(strCollapsed);pexp.parent().append(strExpanded);pexp.nextAll().slideUp();pexp.remove();}}
else
{pexp.slideDown();pexp.nextAll().slideUp();}}
function showFullArticle(){var pexp=$jq('#expandCollapseArea');pexp.slideUp();pexp.nextAll().slideDown();}
*/

function ratings(rateing_id,rating_class){document.getElementById('rate').className="rating "+rating_class+"star";var value='';switch(rating_class){case"one":value=1;break;case"two":value=2;break;case"three":value=3;break;case"four":value=4;break;case"five":value=5;break;}
document.getElementById('rateIt').value=value;document.getElementById('comment').focus();}
function setupSidebarImageList()
{var $kids=$jq("#divSidebarImages").children();var len=$kids.length;$jq("#sidebarImageCount").html(len);moveSidebarImagePage(-1);}
function setNavigationClasses(isPreviousEnabled,isNextEnabled)
{$jq("#sidebarImagePrevious").removeClass("previous","previous_disabled");$jq("#sidebarImagePrevious").addClass(isPreviousEnabled?"previous":"previous_disabled");$jq("#sidebarImageNext").removeClass("next","next_disabled");$jq("#sidebarImageNext").addClass(isNextEnabled?"next":"next_disabled");}
function moveSidebarImagePage(direction)
{var currentPage=Number($jq("#sidebarCurrentPage").html());var totalCount=Number($jq("#sidebarImageCount").html());if(!((currentPage==1&&direction<0)||(currentPage==totalCount&&direction>0)))
{currentPage=currentPage+direction;$jq("#sidebarCurrentPage").html(currentPage);}
setNavigationClasses(currentPage!=1,currentPage!=totalCount);setCurrentImageLayout(currentPage);}
function setCurrentImageLayout(page)
{var currpage=Number(page);var currentSrc='';var currentText='';eval('currentSrc = $jq("#divSidebarImages li:nth-child('+page+') img").attr("content");');eval('currentText = $jq("#divSidebarImages li:nth-child('+page+') p").html();');var csrc=currentSrc.split(';');$jq("#sidebarImage").attr("src",csrc[0]);$jq("#sidebarImage").attr("alt",currentText);$jq("#sidebarImageText").html(currentText);if(csrc.length>1)
$jq("#sidebarEnlargeImage").attr("href",csrc[1]);else
$jq("#sidebarEnlargeImage").attr("href",csrc[0]);}
function DetectEnterPressed(e){var characterCode;if(e&&e.which){e=e;characterCode=e.which;}else{e=event;characterCode=e.keyCode;}
return characterCode==13;}
function ProductSearch(input,url){if(input!=""){window.open(url,'','width=700,height=600,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,status=yes,menubar=yes');}
else{alert("Please enter a text string to search for.");}}
var popCalDstFld;var temp;var popCalWin;function popupCal()
{var tmpDate=new Date();var tmpString="";var tmpNum=0;var popCalDateVal;var dstWindowName="";popCalWin=new Object();if(arguments.length<2)
{alert("popupCal(): Wrong number of arguments.");return void(0);}
dstWindowName=popupCal.arguments[0];popCalDstFld=popupCal.arguments[1];temp=popupCal.arguments[1];popCalDstFmt=popupCal.arguments[2];popCalMonths=popupCal.arguments[3];popCalDays=popupCal.arguments[4];popCalToday=popupCal.arguments[5];popCalClose=popupCal.arguments[6];popCalTitle=popupCal.arguments[7];popCalFirstDayWeek=popupCal.arguments[8];if(popCalDstFld!="")
popCalDstFld=document.getElementById(popCalDstFld);if(popCalDstFmt=="")
popCalDstFmt="m/d/yyyy";if(popCalMonths=="")
popCalMonths="January,February,March,April,May,June,July,August,September,October,November,December";if(popCalDays=="")
popCalDays="Sun,Mon,Tue,Wed,Thu,Fri,Sat";if(popCalToday==""||typeof popCalToday=="undefined")
popCalToday="Today";if(popCalClose==""||typeof popCalClose=="undefined")
popCalClose="Close";if(popCalTitle==""||typeof popCalTitle=="undefined")
popCalTitle="Calendar";tmpString=new String(popCalDstFld.value);if(tmpString=="")
popCalDateVal=new Date()
else
{tmpNum=tmpString.lastIndexOf("/");if((tmpString.length-tmpNum)==3)
{tmpString=tmpString.substring(0,tmpNum+1)+"20"+tmpString.substr(tmpNum+1);popCalDateVal=new Date(tmpString);}
else
{popCalDateVal=getDateFromFormat(tmpString,popCalDstFmt);}}
if(popCalDateVal.toString()=="NaN"||popCalDateVal.toString()=="0")
{popCalDateVal=new Date();popCalDstFld.value="";}
var dateString=String(popCalDateVal.getMonth()+1)+"/"+String(popCalDateVal.getDate())+"/"+String(popCalDateVal.getFullYear());reloadCalPopup(dateString,dstWindowName);return void(0);}
function closeCalPopup()
{popCalWin.close();return void(0);}
function reloadCalPopup()
{var windowFeatures="toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, height=270, width=270, top="+((screen.height-270)/2).toString()+",left="+((screen.width-270)/2).toString();var tmpDate=new Date(reloadCalPopup.arguments[0]);if(tmpDate.toString()=="Invalid Date")
tmpDate=new Date();tmpDate.setDate(1);var popCalData=calPopupSetData(tmpDate,reloadCalPopup.arguments[1]);if(popCalWin.toString()=="[object Object]")
{popCalWin=window.open("",reloadCalPopup.arguments[1],windowFeatures);popCalWin.opener=self;popCalWin.focus();}
else
{popCalWin.document.close();popCalWin.document.clear();}
popCalWin.document.write(popCalData);return void(1);}
function calPopupSetData(firstDay,dstWindowName)
{var popCalData="";var lastDate=0;var fnt=new Array("<FONT SIZE=\"1\">","<B><FONT SIZE=\"2\">","<FONT SIZE=\"2\" COLOR=\"#EF741D\"><B>");var dtToday=new Date();var thisMonth=firstDay.getMonth();var thisYear=firstDay.getFullYear();var nPrevMonth=(thisMonth==0)?11:(thisMonth-1);var nNextMonth=(thisMonth==11)?0:(thisMonth+1);var nPrevMonthYear=(nPrevMonth==11)?(thisYear-1):thisYear;var nNextMonthYear=(nNextMonth==0)?(thisYear+1):thisYear;var sToday=String((dtToday.getMonth()+1)+"/01/"+dtToday.getFullYear());var sPrevMonth=String((nPrevMonth+1)+"/01/"+nPrevMonthYear);var sNextMonth=String((nNextMonth+1)+"/01/"+nNextMonthYear);var sPrevYear1=String((thisMonth+1)+"/01/"+(thisYear-1));var sNextYear1=String((thisMonth+1)+"/01/"+(thisYear+1));var tmpDate=new Date(sNextMonth);tmpDate=new Date(tmpDate.valueOf()-1001);lastDate=tmpDate.getDate();if(this.popCalMonths.split)
{var monthNames=this.popCalMonths.split(",");var dayNames=this.popCalDays.split(",");}
else
{var monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var dayNames=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")}
var styles="<style><!-- body{font-family:Arial,Helvetica,sans-serif;font-size:9pt}; td {  font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #666666}; A { text-decoration: none; };TD.day { border-bottom: solid black; border-width: 0px; }--></style>"
var cellAttribs="align=\"center\" class=\"day\" BGCOLOR=\"#F1F1F1\"onMouseOver=\"temp=this.style.backgroundColor;this.style.backgroundColor='#CCCCCC';\" onMouseOut=\"this.style.backgroundColor=temp;\""
var cellAttribs2="align=\"center\" BGCOLOR=\"#F1F1F1\" onMouseOver=\"temp=this.style.backgroundColor;this.style.backgroundColor='#CCCCCC';\" onMouseOut=\"this.style.backgroundColor=temp;\""
var htmlHead="<HTML><HEAD><TITLE>"+popCalTitle+"</TITLE>"+styles+"</HEAD><BODY BGCOLOR=\"#F1F1F1\" TEXT=\"#000000\" LINK=\"#364180\" ALINK=\"#FF8100\" VLINK=\"#424282\">";var htmlTail="</BODY></HTML>";var closeAnchor="<CENTER><input type=button value=\""+popCalClose+"\" onClick=\"javascript:window.opener.closeCalPopup()\"></CENTER>";var todayAnchor="<A HREF=\"javascript:window.opener.reloadCalPopup('"+sToday+"','"+dstWindowName+"');\">"+popCalToday+"</A>";var prevMonthAnchor="<A HREF=\"javascript:window.opener.reloadCalPopup('"+sPrevMonth+"','"+dstWindowName+"');\">"+monthNames[nPrevMonth]+"</A>";var nextMonthAnchor="<A HREF=\"javascript:window.opener.reloadCalPopup('"+sNextMonth+"','"+dstWindowName+"');\">"+monthNames[nNextMonth]+"</A>";var prevYear1Anchor="<A HREF=\"javascript:window.opener.reloadCalPopup('"+sPrevYear1+"','"+dstWindowName+"');\">"+(thisYear-1)+"</A>";var nextYear1Anchor="<A HREF=\"javascript:window.opener.reloadCalPopup('"+sNextYear1+"','"+dstWindowName+"');\">"+(thisYear+1)+"</A>";popCalData+=(htmlHead+fnt[1]);popCalData+=("<DIV align=\"center\">");popCalData+=("<TABLE BORDER=\"0\" cellspacing=\"0\" callpadding=\"0\" width=\"250\"><TR><TD width=\"45\"> </TD>");popCalData+=("<TD width=\"45\" align=\"center\" "+cellAttribs2);popCalData+=(" >");popCalData+=(fnt[0]+prevYear1Anchor+"</FONT></TD>");popCalData+=("<TD width=\"70\" align=\"center\" "+cellAttribs2);popCalData+=(" >");popCalData+=(fnt[0]+todayAnchor+"</FONT></TD>");popCalData+=("<TD width=\"45\" align=\"center\" "+cellAttribs2);popCalData+=(" >");popCalData+=(fnt[0]+nextYear1Anchor+"</FONT></TD><TD width=\"45\"> </TD>");popCalData+=("</TR></TABLE>");popCalData+=("<TABLE BORDER=\"0\" cellspacing=\"0\" callpadding=\"0\" width=\"250\">");popCalData+=("<TR><TD width=\"55\" align=\"center\" "+cellAttribs2);popCalData+=(" >");popCalData+=(fnt[0]+prevMonthAnchor+"</FONT></TD>");popCalData+=("<TD width=\"140\" align=\"center\">");popCalData+=("  "+fnt[1]+"<FONT COLOR=\"#000000\">"+monthNames[thisMonth]+", "+thisYear+"  </FONT></TD>");popCalData+=("<TD width=\"55\" align=\"center\" "+cellAttribs2);popCalData+=(" >");popCalData+=(fnt[0]+nextMonthAnchor+"</FONT></TD></TR></TABLE><BR>");popCalData+=("<TABLE BORDER=\"0\" cellspacing=\"2\" cellpadding=\"1\"  width=\"245\">");popCalData+=("");popCalData+=("<TR>");var xday=0;for(xday=0;xday<7;xday++)
{popCalData+=("<TD width=\"35\" align=\"center\">"+fnt[1]+"<FONT COLOR=\"#000000\">"+dayNames[(xday+popCalFirstDayWeek)%7]+"</FONT></TD>");};popCalData+=("</TR>");var calDay=0;var monthDate=1;var weekDay=firstDay.getDay();do
{popCalData+=("<TR>");for(calDay=0;calDay<7;calDay++)
{if(((weekDay+7-popCalFirstDayWeek)%7!=calDay)||(monthDate>lastDate))
{popCalData+=("<TD width=\"35\">"+fnt[1]+" </FONT></TD>");continue;}
else
{anchorVal="<A HREF=\"javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'"+constructDate(monthDate,thisMonth+1,thisYear)+"');window.opener.closeCalPopup()\">";jsVal="javascript:window.opener.calPopupSetDate(window.opener.popCalDstFld,'"+constructDate(monthDate,thisMonth+1,thisYear)+"');window.opener.closeCalPopup()";popCalData+=("<TD width=\"35\" "+cellAttribs+" onClick=\""+jsVal+"\">");if((firstDay.getMonth()==dtToday.getMonth())&&(monthDate==dtToday.getDate())&&(thisYear==dtToday.getFullYear()))
popCalData+=(anchorVal+fnt[2]+monthDate+"</A></FONT></TD>");else
popCalData+=(anchorVal+fnt[1]+monthDate+"</A></FONT></TD>");weekDay++;monthDate++;}}
weekDay=popCalFirstDayWeek;popCalData+=("</TR>");}while(monthDate<=lastDate);popCalData+=("</TABLE></DIV><BR>");popCalData+=(closeAnchor+"</FONT>"+htmlTail);return(popCalData);}
function calPopupSetDate()
{calPopupSetDate.arguments[0].value=calPopupSetDate.arguments[1];}
function padZero(num)
{return((num<=9)?("0"+num):num);}
function constructDate(d,m,y)
{var fmtDate=this.popCalDstFmt
fmtDate=fmtDate.replace('dd',padZero(d))
fmtDate=fmtDate.replace('d',d)
fmtDate=fmtDate.replace('MM',padZero(m))
fmtDate=fmtDate.replace('M',m)
fmtDate=fmtDate.replace('yyyy',y)
fmtDate=fmtDate.replace('yy',padZero(y%100))
return fmtDate;}
function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false;}}
return true;}
function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null;}
if(_isInteger(token)){return token;}}
return null;}
function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);}
if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4;}
if(token=="yy"){x=2;y=2;}
if(token=="y"){x=2;y=4;}
year=_getInt(val,i_val,x,y);if(year==null){return 0;}
i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0);}
else{year=2000+(year-0);}}}
else if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0;}
i_val+=month.length;}
else if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0;}
i_val+=date.length;}
else{if(val.substring(i_val,i_val+token.length)!=token){return 0;}
else{i_val+=token.length;}}}
if(i_val!=val.length){return 0;}
if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0;}}
else{if(date>28){return 0;}}}
if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0;}}
var newdate=new Date(year,month-1,date);return newdate;}
(function($){function fireEvent(opts,name,self,arg){var fn=opts[name];if($.isFunction(fn)){try{return fn.call(self,arg);}catch(error){if(opts.alert){alert("Error calling scrollable."+name+": "+error);}else{throw error;}
return false;}}
return true;}
var current=null;function Scrollable(root,conf){var self=this;if(!current){current=self;}
var horizontal=!conf.vertical;var wrap=$(conf.items,root);var index=0;var navi=root.siblings(conf.navi).eq(0);var prev=root.siblings(conf.prev).eq(0);var next=root.siblings(conf.next).eq(0);var prevPage=root.siblings(conf.prevPage).eq(0);var nextPage=root.siblings(conf.nextPage).eq(0);$.extend(self,{getVersion:function(){return[1,0,1];},getIndex:function(){return index;},getConf:function(){return conf;},getSize:function(){return self.getItems().size();},getPageAmount:function(){return Math.ceil(this.getSize()/conf.size);},getPageIndex:function(){return Math.ceil(index/conf.size);},getRoot:function(){return root;},getItemWrap:function(){return wrap;},getItems:function(){return wrap.children();},seekTo:function(i,time,fn){time=time||conf.speed;if($.isFunction(time)){fn=time;time=conf.speed;}
if(i<0){i=0;}
if(i>self.getSize()-conf.size){return self;}
var item=self.getItems().eq(i);if(!item.length){return self;}
if(fireEvent(conf,"onBeforeSeek",self,i)===false){return self;}
if(horizontal){var left=-(item.outerWidth(true)*i);wrap.animate({left:left},time,conf.easing,fn?function(){fn.call(self);}:null);}else{var top=-(item.outerHeight(true)*i);wrap.animate({top:top},time,conf.easing,fn?function(){fn.call(self);}:null);}
if(navi.length){var klass=conf.activeClass;var page=Math.ceil(i/conf.size);page=Math.min(page,navi.children().length-1);navi.children().removeClass(klass).eq(page).addClass(klass);}
if(i===0){prev.add(prevPage).addClass(conf.disabledClass);}else{prev.add(prevPage).removeClass(conf.disabledClass);}
if(i>=self.getSize()-conf.size){next.add(nextPage).addClass(conf.disabledClass);}else{next.add(nextPage).removeClass(conf.disabledClass);}
current=self;index=i;fireEvent(conf,"onSeek",self,i);return self;},move:function(offset,time,fn){var to=index+offset;if(conf.loop&&to>(self.getSize()-conf.size)){to=0;}
return this.seekTo(to,time,fn);},next:function(time,fn){return this.move(1,time,fn);},prev:function(time,fn){return this.move(-1,time,fn);},movePage:function(offset,time,fn){return this.move(conf.size*offset,time,fn);},setPage:function(page,time,fn){var size=conf.size;var index=size*page;var lastPage=index+size>=this.getSize();if(lastPage){index=this.getSize()-conf.size;}
return this.seekTo(index,time,fn);},prevPage:function(time,fn){return this.setPage(this.getPageIndex()-1,time,fn);},nextPage:function(time,fn){return this.setPage(this.getPageIndex()+1,time,fn);},begin:function(time,fn){return this.seekTo(0,time,fn);},end:function(time,fn){return this.seekTo(this.getSize()-conf.size,time,fn);},reload:function(){return load();},click:function(index,time,fn){var item=self.getItems().eq(index);var klass=conf.activeClass;if(!item.hasClass(klass)&&(index>=0||index<this.getSize())){self.getItems().removeClass(klass);item.addClass(klass);var delta=Math.floor(conf.size/2);var to=index-delta;if(to>self.getSize()-conf.size){to--;}
if(to!==index){return this.seekTo(to,time,fn);}}
return self;}});if($.isFunction($.fn.mousewheel)){root.bind("mousewheel.scrollable",function(e,delta){var step=$.browser.opera?1:-1;self.move(delta>0?step:-step,50);return false;});}
prev.addClass(conf.disabledClass).click(function(){self.prev();});next.click(function(){self.next();});nextPage.click(function(){self.nextPage();});prevPage.addClass(conf.disabledClass).click(function(){self.prevPage();});if(conf.keyboard){$(window).unbind("keypress.scrollable").bind("keypress.scrollable",function(evt){var el=current;if(!el){return;}
if(horizontal&&(evt.keyCode==37||evt.keyCode==39)){el.move(evt.keyCode==37?-1:1);return evt.preventDefault();}
if(!horizontal&&(evt.keyCode==38||evt.keyCode==40)){el.move(evt.keyCode==38?-1:1);return evt.preventDefault();}
return true;});}
function load(){navi.each(function(){var nav=$(this);if(nav.is(":empty")||nav.data("me")==self){nav.empty();nav.data("me",self);for(var i=0;i<self.getPageAmount();i++){var item=$("<"+conf.naviItem+"/>").attr("href",i).click(function(e){var el=$(this);el.parent().children().removeClass(conf.activeClass);el.addClass(conf.activeClass);self.setPage(el.attr("href"));return e.preventDefault();});if(i===0){item.addClass(conf.activeClass);}
nav.append(item);}}else{var els=nav.children();els.each(function(i){var item=$(this);item.attr("href",i);if(i===0){item.addClass(conf.activeClass);}
item.click(function(){nav.find("."+conf.activeClass).removeClass(conf.activeClass);item.addClass(conf.activeClass);self.setPage(item.attr("href"));});});}});if(conf.clickable){self.getItems().each(function(index,arg){var el=$(this);if(!el.data("set")){el.bind("click.scrollable",function(){self.click(index);});el.data("set",true);}});}
if(conf.hoverClass){self.getItems().hover(function(){$(this).addClass(conf.hoverClass);},function(){$(this).removeClass(conf.hoverClass);});}
return self;}
load();var timer=null;function setTimer(){timer=setInterval(function(){self.next();},conf.interval);}
if(conf.interval>0){root.hover(function(){clearInterval(timer);},function(){setTimer();});setTimer();}}
jQuery.prototype.scrollable=function(conf){var api=this.eq(typeof conf=='number'?conf:0).data("scrollable");if(api){return api;}
var opts={size:5,vertical:false,clickable:false,loop:false,interval:0,speed:400,keyboard:true,activeClass:'active',disabledClass:'disabled',hoverClass:null,easing:'swing',items:'.items',prev:'.prev',next:'.next',prevPage:'.prevPage',nextPage:'.nextPage',navi:'.navi',naviItem:'a',onBeforeSeek:null,onSeek:null,alert:true};$jq.extend(opts,conf);this.each(function(){var el=new Scrollable($(this),opts);$jq(this).data("scrollable",el);});return this;};})(jQuery);

